import neu.soft.App;
import neu.soft.constant.OrderType;
import neu.soft.entity.NormalOrder;
import neu.soft.entity.User;
import neu.soft.feignclient.WarehouseFeignClient;
import neu.soft.mapper.OrderMapper;
import neu.soft.mapper.TestMapper;
import neu.soft.mapper.UserMapper;
import neu.soft.service.OrderService;
import neu.soft.vo.ResultBean;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = App.class)
public class test03 {
    @Autowired
    OrderMapper orderMapper;

    @Autowired
    OrderService orderService;
    @Test
    public void TestgetUserOrder(){
       // List<NormalOrder> userOrder = orderMapper.findUserOrder("e1b2f20ccfce069f09d904a80c704b93");
       Map<String,Object>map = new HashMap<>();
       map.put("uid","e1b2f20ccfce069f09d904a80c704b93");
        orderService.findUserOrder(map).forEach(System.out::println);
    }

    @Test
    public void TestDeleteOrder(){
        // List<NormalOrder> userOrder = orderMapper.findUserOrder("e1b2f20ccfce069f09d904a80c704b93");
        Map<String,Object>map = new HashMap<>();
        map.put("oid","0277f5dc208111eeaa0a5c3a45dad1b2");
        System.out.println(orderMapper.deleteUselessOrder(map));
    }
}
